import ant
import os,threading,Queue
from paintingant import painter
class compresser(threading.Thread):
	pile = Queue.Queue()
	def run(self):
		while True:
			twig = compresser.pile.get()
			ant.Ant.leave("compresser")
			painter.pile.put(self.fetchtwig(twig)) ##R# Put to painter's pile
			compresser.pile.task_done()
			ant.Ant.comehome("compresser")
	def fetchtwig(self,info):
		os.system("convert \""+info[3]+"\" -quality 90% \""+info[3]+"\"") ## Call to magick
		return info												 ##R# Return unchanged info
